﻿using CSRedis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S.Authorization.Domain.Redis
{
    public class MyRedisHelper
    {
        CSRedisClient client=new CSRedisClient("127.0.0.1");

        /// <summary>
        /// 哈希类型的添加
        /// </summary>
        /// <param name="key">表名</param>
        /// <param name="field">key值</param>
        /// <param name="value">value值</param>
        /// <returns>返回是否添加成功</returns>
        public bool HMSet (string key,string field,object value)
        {
            return client.HMSet (key, field, value);
        } 
        /// <summary>
        /// 哈希表用过key查询对应的值
        /// </summary>
        /// <param name="key"></param>
        /// <param name="field"></param>
        /// <returns>返回该field下的value值</returns>
        public string[] HMGet(string key,string field) {
            return client.HMGet(key, field);
        }
    }
}
